<template>
    <template v-for="menu in menus"> 
        <el-sub-menu v-if="menu.component === 'index'" :index="menu.menuEname" :key="menu.menuEname">
            <template #title>
               <el-icon>
                <component :is="menu.menuIcon"></component>
               </el-icon>
                {{menu.menuName}}
            </template>
            <SubSideBar v-if="menu.children && menu.children.length > 0" :menus="menu.children" ></SubSideBar>
        </el-sub-menu>
        <el-menu-item v-else :index="menu.menuEname">
            <template #title>
               <el-icon>
                <component :is="menu.menuIcon"></component>
               </el-icon>
                {{menu.menuName}}
            </template></el-menu-item>
    </template>
</template>

<script setup>

let props=defineProps(["menus"])
console.log(props.menus)
</script>

<style scoped>

</style>
